<?php
	$sql=$mysqli->query("SELECT  qldl_tour.MA_TOUR, qldl_tour.HINH_ANH, qldl_tour.TEN_TOUR, qldl_tour.GIA, 
							qldl_chi_tiet_khuyen_mai.TG_BD_KM,qldl_chi_tiet_khuyen_mai.TG_KT_KM,
							qldl_tour.SO_NGAY,qldl_khuyen_mai.NOI_DUNG, qldl_khuyen_mai.TIEU_DE,qldl_tour.SO_CHO
							FROM qldl_khuyen_mai inner join qldl_chi_tiet_khuyen_mai
							on qldl_khuyen_mai.ma_khuyen_mai=qldl_chi_tiet_khuyen_mai.ma_khuyen_mai
							inner join qldl_tour 
							on qldl_chi_tiet_khuyen_mai.ma_tour=qldl_tour.ma_tour
							LIMIT 0 , 2");
	while ($row=$sql->fetch_array()){
		$giagiam = $row['GIA']-$row['GIA']*$row['TIEU_DE']/100;

		$date=strtotime($row['TG_BD_KM']);
		$data =date('d-m-Y',$date);

		$da=strtotime($row['TG_KT_KM']);
		$dat =date('d-m-Y',$da);
		echo "<ul class='list-tour'>
   				<li>
				<img src='admin/tour/upload/news/".$row['HINH_ANH']."'  width='180' height='150'/>
				<div class='info-tour'>
                <b><a href='index.php?id=chitiet&page=".$row['MA_TOUR']."'><font style='text-transform:uppercase'>".
                $row['TEN_TOUR']."</a></font></b><br />
				<font color='#000' face='Tahoma, Geneva, sans-serif' style='font-size:12pt;text-decoration:line-through;'>"
				.number_format($row['GIA'],0,",",".")."&nbspVNĐ</font><br />
				<font color='#FF0000' face='Tahoma, Geneva, sans-serif' style='font-weight:bold;font-size:13pt'>"
				.number_format($giagiam,0,",",".")."&nbspVNĐ</font><br />
                <font style='font-size:13pt;'>
                <B>Hình thức khuyến mãi: </B>".$row['NOI_DUNG']."<br />
                <B>Khuyến mãi từ ngày: </B>".$data."<br />
				<B>Đến ngày: </B>".$dat."<br />
				<b>Số chỗ còn lại: </b> <font color='#FF0000' face='Tahoma, Geneva, sans-serif' style='font-weight:bold;font-size:13pt'>" .$row['SO_CHO']."</font><br>
				</font></div></li></ul><hr />";
	}
?>